home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / examples / text_io_.adb < prev    next >
Text File  |  1994-05-13  |  644b  |  21 lines

  1. with Text_Io; use Text_Io;
  2. procedure Text_IO_Example is
  3.    type Color is (red, blue, green);
  4.    package Int_Io is new Integer_IO (Integer); use Int_Io;
  5.    package Flt_Io is new Float_IO (Float); use Flt_Io;
  6.    package Color_Io is new Enumeration_Io (Color); use Color_Io;
  7.    X : Float;
  8.    Last : Positive;
  9. begin
  10.    Put_Line ("The following should be a five in base two:"); 
  11.    Put (5, Width => 7, Base => 2);
  12.    New_Line;
  13.    Get ("  23.4567 ", X, Last);
  14.    Put_Line ("The following should be 2.34567E+01");
  15.    Put (X);
  16.    New_Line;
  17.    Put_Line ("The following should be RED");
  18.    Put (red, Set => Upper_Case);
  19.    New_Line;
  20. end Text_IO_Example;
  21.